//电池
$(function(){
	function dianChi(obj) {
		var dianchi=obj;
		var timer=null;
		this.chongdian=function(dlcolor){
			//电池距离body顶部的高度
			dianchi.h=240;
			
			for (var i=0;i<42;i++){
				$('<div class="dc-line"></div><div class="dc-dl" style="background:'+dlcolor+'"></div>').appendTo(dianchi);
			}
			timer=setInterval(function(){
				if(dianchi.h>0){
					dianchi.css("paddingTop",dianchi.h+"px");
				} else{
					dianchi.h=240;
				}
				dianchi.h-=6;
				
			},100)
		}
	}
	var dc1=new dianChi($("#dc1"));
	dc1.chongdian("blue");
});